export default (router,services,middlewares) => {
    router.get('/api/recommend',middlewares,async (ctx,next)=>{
        const res = await services.recommend.getRecommend();
        const dataSource = res.data.listData;
        const totalPage = Math.ceil(Number(res.data.totalCount) / 4);
        const productArry = res.data.totalCount <= 4? res.data.totalCount: res.data.listData.slice(0, 4);
        const data = {
            dataSource,
            totalPage,
            productArry
        }
        ctx.body = data;
    })
}